import router from './router'
import defaultSettings from '@/settings' // 获取全局设置

const { basePage } = defaultSettings // 在全局设置中获取默认页面的路径

import getPageTitle from '@/utils/get-page-title'
router.beforeEach(async(to, from, next) => {
  document.title = getPageTitle(to.meta.title)
  if (to.path !== '/') {
    next() // 跳过路由拦截
  } else {
    next({ path: basePage }) // 当路径为/时跳转到默认页面
  }
})

router.afterEach(() => {

})
